package com.slz3.business.module.systemManagement.sysFunction.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.systemManagement.sysFunction.domain.SysFunction;
import com.slz3.business.module.systemManagement.sysFunction.domain.SysFunctionCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class SysFunctionResAtomic {

    static Mono<ServerResponse> add_$SysFunctionUpdateLock(ServerRequest req, SysFunction sysFunction) {
        return SysFunctionResSafeValid.add(req, sysFunction) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysFunctionResExecutor.add(req, sysFunction);
    }

    public static Mono<ServerResponse> delete_$SysFunctionUpdateLock(ServerRequest req, SysFunctionCondition sysFunctionCondition) {
        return SysFunctionResSafeValid.delete(req, sysFunctionCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysFunctionResExecutor.delete(req);
    }

    static Mono<ServerResponse> modify_$SysFunctionUpdateLock(ServerRequest req, SysFunction sysFunction) {
        return SysFunctionResSafeValid.modify(req, sysFunction) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysFunctionResExecutor.modify(req, sysFunction);
    }

    static Mono<ServerResponse> info_$SysFunctionUpdateLock(ServerRequest req) {
        return SysFunctionResSafeValid.info(req) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysFunctionResExecutor.info(req);
    }

    public static Mono<ServerResponse> auditSubmit_$SysFunctionUpdateLock(ServerRequest req, SysFunctionCondition sysFunctionCondition) {
        return SysFunctionResSafeValid.auditSubmit(req, sysFunctionCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysFunctionResExecutor.auditSubmit(req);
    }

    public static Mono<ServerResponse> audit_$SysFunctionUpdateLock(ServerRequest req, SysFunctionCondition sysFunctionCondition) {
        return SysFunctionResSafeValid.audit(req, sysFunctionCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysFunctionResExecutor.audit(req);
    }

    public static Mono<ServerResponse> auditReject_$SysFunctionUpdateLock(ServerRequest req, SysFunctionCondition sysFunctionCondition) {
        return SysFunctionResSafeValid.auditReject(req, sysFunctionCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysFunctionResExecutor.auditReject(req);
    }


    public static Mono<ServerResponse> usingEnable_$SysFunctionUpdateLock(ServerRequest req, SysFunctionCondition sysFunctionCondition) {
        return SysFunctionResSafeValid.usingEnable(req, sysFunctionCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysFunctionResExecutor.usingEnable(req);
    }

    public static Mono<ServerResponse> usingDisable_$SysFunctionUpdateLock(ServerRequest req, SysFunctionCondition sysFunctionCondition) {
        return SysFunctionResSafeValid.usingDisable(req, sysFunctionCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysFunctionResExecutor.usingDisable(req);
    }
}
